fix(#59): add crash reporting, detection and data recovery#490
Merged
Conversation
autoFocus opens the keyboard immediately on mount, which can block UI elements before the screen finishes rendering. Replace it with a ref-based focus triggered after a 300 ms delay, giving the navigation transition time to complete on both iOS and Android. - Add nameInputRef (useRef<TextInput>) to the name field - Remove autoFocus prop from the name TextInput - Focus the input programmatically after 300 ms in a useEffect - Import useRef from React
…lity tracking - Switch KeyboardAvoidingView behavior to 'padding' on iOS and undefined on Android (Android handles scroll natively) - Track keyboard show/hide events with Keyboard listeners to set isKeyboardVisible state - Apply extra bottom padding to ScrollView content when keyboard is open so all form fields remain reachable - Import Keyboard from react-native
- Add src/services/crashReporter.ts: persists crash records to AsyncStorage, installs a global ErrorUtils handler for uncaught JS errors, detects previous crash on next launch, and supports optional remote endpoint reporting - Add src/components/CrashRecoveryModal.tsx: modal shown on launch when a previous crash is detected; lets user trigger data recovery or continue without recovering - Update ErrorBoundary to call crashReporter.recordCrash() in componentDidCatch so React render errors are also persisted
- Initialize crashReporter early in App startup (alongside i18n) - On launch, if a previous crash is detected, show CrashRecoveryModal - handleRecover calls crashReporter.attemptDataRecovery() which clears corrupted AsyncStorage state while preserving settings and auth keys - handleDismissRecovery marks the crash as notified so the modal does not reappear on subsequent launches - Import Alert for recovery-failure feedback
|
@senmalong Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #59
Implements crash detection, user notification, data recovery, and crash logging — no third-party SDK required (uses AsyncStorage which is already a project dependency).
Files changed
src/services/crashReporter.ts(new)ErrorUtilshandler to catch uncaught JS errors that escape React error boundariesattemptDataRecovery()clears corrupted AsyncStorage state while preserving user settings and auth keysreportingEndpointfor future Sentry/Crashlytics integrationsrc/components/CrashRecoveryModal.tsx(new)crashReporter.attemptDataRecovery()__DEV__modesrc/components/ErrorBoundary.tsx(updated)componentDidCatchnow callscrashReporter.recordCrash()so React render errors are persistedApp.tsx(updated)crashReporteralongside i18n at startupCrashRecoveryModalwhen neededAcceptance Criteria
Platform.OSaware APIs only)